package com.tang.dao.impl;

import com.tang.bean.Book;
import com.tang.bean.Order;
import com.tang.bean.OrderItem;
import com.tang.dao.BaseDao;
import com.tang.dao.OrderItemDao;
import java.util.List;

public class OrderItemDaoImpl extends BaseDao<OrderItem> implements OrderItemDao {
  @Override
  public void insertOrderItemArr(Object[][] orderItemArrParam) {
    String sql = "insert into t_order_item (book_name,price,img_path,item_count,item_amount,order_id) values (?,?,?,?,?,?)";
    batchUpdate(sql,orderItemArrParam);
  }

  @Override
  public List<OrderItem> getOrderDetails(Integer orderId) throws Exception {
    String sql="select item_id itemId,book_name bookName,price,img_path imgPath,item_count itemCount,item_amount itemAmount,order_id orderId from t_order_item where order_id = ?";
    return getBeanList(OrderItem.class, sql, orderId);
  }

}